package cn.dtsmusic.config;

import org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer;
import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;

import io.undertow.Undertow.Builder;
/**
 * 
 * @author leobelive
 *
 */
public class UndertowConfig {

	
	@Bean
    public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
        UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory(8066);
        factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {
			
            @Override
            public void customize(Builder builder) {
                builder.addHttpListener(8088, "0.0.0.0");  //增加  http 的访问端口
            }

        });
        // dev 配置覆盖了
        //factory.setPort(8060);
        //System.out.println("----------------------------------factory.getPort()::"+factory.getPort());
        return factory;
    }
}
